window.onload = function() {
	var divNode = document.getElementById("watch");

	function getTime() {
		var date = new Date();
		var year = date.getFullYear();
		var month = date.getMonth() + 1;
		var day = date.getDate();
		var weekDay = function() {
			switch (date.getDay()) {
				case 0:
					return "Sunday";
				case 1:
					return "Monday";
				case 2:
					return "Tuesday";
				case 3:
					return "Wednesday";
				case 4:
					return "Thursday";
				case 5:
					return "Firday";
				case 6:
					return "Saturday";
			}
		}
		var hour = date.getHours();
		var min = date.getMinutes();
		var sec = date.getSeconds();
		return "Now time is " + year + "/" + month + "/" + day + "&emsp;" + hour + ":" + min + ":" + sec + "&emsp;" + weekDay();
	}
	setInterval(function(){
		var nowTime = getTime();
		divNode.innerHTML = nowTime;
	},1000);
}
